/**
 *
 * jcrt and its source-code is licensed under the LGPL.
 * You may copy, adapt, and redistribute this file for commercial or non-commercial use.
 * When copying, adapting, or redistributing this document in keeping with the guidelines above,
 * you are required to provide proper attribution to obinary.
 * If you reproduce or distribute the document without making any substantive modifications to its content,
 * please use the following attribution line:
 *
 * Copyright 2007 Atjava.com Ltd. (http://www.atjava.com) All rights reserved.
 *
 */
package com.atjava.jcrweb.info;

import java.util.Calendar;

import com.atjava.jcrt.BaseInfo;
import com.atjava.jcrt.core.ItemType;
/**
 * User Info Class
 * @author biggie
 *
 */
public class UserInfo extends BaseInfo {

	private static final long serialVersionUID = 1L;
	
	public UserInfo() {
		super(ItemType.NODE);
	}

	private String userCode;
	private String userName;
	private String password;
	private String mail;
	private String permissionDirPath;
	
	private Calendar datetime;
	private String note;

	public String getUserCode() {
		return userCode;
	}
	public void setUserCode(String userCode) {
		this.userCode = userCode;
	}
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public String getMail() {
		return mail;
	}
	public void setMail(String mail) {
		this.mail = mail;
	}
	public String getPermissionDirPath() {
		return permissionDirPath;
	}
	public void setPermissionDirPath(String permissionDirPath) {
		this.permissionDirPath = permissionDirPath;
	}
	public Calendar getDatetime() {
		return datetime;
	}
	public void setDatetime(Calendar datetime) {
		this.datetime = datetime;
	}
	public String getNote() {
		return note;
	}
	public void setNote(String note) {
		this.note = note;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	
	public String[] getPermissionPath(){
		if(this.permissionDirPath == null){
			return null;
		}
		if(this.permissionDirPath.length() == 0){
			return null;
		}
		if(this.permissionDirPath.indexOf(",")==-1){
			return new String[]{this.permissionDirPath};
		}
		return permissionDirPath.split(",");
	}
	
	
}
